package com.work.ygj.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.work.ygj.entity.Notice;
import com.work.ygj.mapper.NoticeMapper;
import com.work.ygj.pojo.dto.NoticeDto;
import com.work.ygj.pojo.vo.GcTypeVo;
import com.work.ygj.pojo.vo.NoticeVo;
import com.work.ygj.service.NoticeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ygj
 * @since 2022-03-27
 */
@Service
public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements NoticeService {

    @Resource
    private NoticeMapper noticeMapper;

    @Override
    public IPage<NoticeVo> selectList(NoticeDto dto) {
        IPage<NoticeVo> page = new Page<>(dto.getPageIndex(), dto.getPageSize());
        List<NoticeVo> list = noticeMapper.noticeList(page,dto);
        page.setRecords(list);
        return page;
    }
}
